package br.com.guardaroupavirtual.helper;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DataHelper {

	public static Date stringToDate(String data){
		Date d = null;
		try {
			SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");  
			d = format.parse(data); 
		} catch (Exception e) {
			System.out.println("Erro ao converter data: "+e.getMessage());
		}
		return d;
	}
	
	public static String dateToString(Date data){
		try {
			SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");  
			return format.format(data); 
		} catch (Exception e) {
		}
		return "";		
	}
	
}
